package com.study.scala.file
import java.io._
import scala.io.Source
import scala.io.BufferedSource

object File {

  def main(args: Array[String]): Unit = {

    var source3 = Source.fromFile("D:\\58\\workspace\\scala-study\\src\\data.txt", "utf-8");
    val lineIterator = source3.getLines();

    for (l <- lineIterator) {
      println(l)
    }

    var source2 = Source.fromURL("https://baike.baidu.com/item/%E5%90%9B%E4%B9%90%E5%AE%9D/10977003?fr=aladdin");
    val lineIterator2 = source2.getLines();

    for (l <- lineIterator2) {
      println(l)
    }

  }

}